@extends('users.app')
@section('title', '添加通知')
@section('content')

<div class="container">
  <div class="col-md-10 offset-md-1">
    <div class="card ">

      <div class="card-header">
        <h1>
          创建通知
        </h1>
      </div>

      <div class="card-body">
        @if($notice->id)
          <form action="{{ route('notices.update', $notice->id) }}" method="POST" accept-charset="UTF-8">
          <input type="hidden" name="_method" value="PUT">
        @else
          <form action="{{ route('notices.store') }}" method="POST" accept-charset="UTF-8">
        @endif

          @include('common.error')

          <input type="hidden" name="_token" value="{{ csrf_token() }}">
            <div class="form-group">
              <label for="title">标题</label>
              <input name="title" id="title" class="form-control" value="{{ old('title', $notice->title ) }}">
            </div>

                <div class="form-group">
                	<label for="content-field">内容</label>
                	<textarea name="content" id="content-field" class="form-control" rows="3">{{ old('content', $notice->content ) }}</textarea>
                </div>

          <div class="well well-sm">
            <button type="submit" class="btn btn-primary">Save</button>
            <a class="btn btn-link float-xs-right" href="{{ route('notices.index') }}"> <- Back</a>
          </div>
        </form>
      </div>
    </div>
  </div>
</div>

@endsection
